package com.guoheng.hazard.sys.controller;

import com.guoheng.hazard.common.base.Result;
import com.guoheng.hazard.sys.model.dto.LoginDTO;
import com.guoheng.hazard.sys.service.LoginService;
import io.swagger.annotations.Api;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 类功能描述:　用户登录
 *
 * @author fbl
 * @date 2019-26-11 14:26
 */
@RestController
@Validated
@Api(value = "用户登录")
public class LoginController {
    @Resource
    LoginService loginService;

    @PostMapping(value = "user/login")
    public Result userLogin(@RequestBody @Valid LoginDTO loginDTO){
        return loginService.userLogin(loginDTO);
    }
}